home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / cattool / cntnts20.zip / ELF.DOC < prev    next >
Text File  |  1989-12-30  |  3KB  |  79 lines

  1.  
  2.                                   E - L - F
  3.  
  4.                            (E)rror  (L)evel  (F)ile
  5.  
  6.                                 Documentation
  7.  
  8.  
  9. INTRODUCTION:
  10.  
  11. ELF was written to fill two needs:  The need to allow operator input
  12. in batch files, in the form of Yes/No answers, and the need to force
  13. ERRORLEVEL to a specified value.  The former function is available in
  14. several programs, but the latter is not.  ELF combines both into one
  15. easy to use program.
  16.  
  17. DISCLAIMER:
  18.  
  19. This program is placed in the public domain.  Permission is granted 
  20. to copy, give away, and distribute this package.  Permission is
  21. expressly denied to anyone to sell this software, other than nominal
  22. costs for media.  The user bears all responsibility for testing & use.
  23. If ELF turns out to be a virus that wipes out your hardware, you have
  24. no-one to blame but yourself.  The source code is included for your safety.
  25. If the possibility of trojan horse or virus programs disturbs you, please
  26. carefully examine the source code, and then re-assemble it yourself. If
  27. you didn't receive the source code, then request it from the source from
  28. which you received this software.  Alternately, close inspection with 
  29. a debugger is in order.  ELF is really a trivial program, so dis-assembly
  30. is easy.  In actuality, I have been using Public Domain software for years
  31. and have *never* had any problems, so the above is not intended to make
  32. you paranoid.  It is intended to protect the author of this, and the authors
  33. of all legitimate public domain or shareware software.  Enjoy.
  34.  
  35.  
  36. USE:
  37.  
  38. Invoke as:  ELF XX <CR>  where XX is a two digit HEXADECIMAL number.  Hex
  39. was used out of pure laziness on the part of the programmer.  ELF will 
  40. simply terminate with the appropriate ERRORLEVEL set without printing anything.
  41. This is useful for "tacking-on" ERRORLEVEL control for batch files with
  42. programs that don't support ERRORLEVEL.  BASIC is a good example.  If
  43. running a BASIC program under a batch process, chain to ELF upon termination
  44. to set up an ERRORLEVEL parameter.  Remember that while ELF uses hex
  45. arguments, the ERRORLEVEL statement in your batch file uses the decimal
  46. equivalent.
  47.  
  48. The other form is:  ELF <CR>.  This will print (Y/N)? on the console, and
  49. wait for the Y or N key to be pressed. (Either case).  All other keys are
  50. ignored.  This is great for run time operator input with batch files.  I
  51. use it in my AUTOEXEC.BAT file to ask whether or not to attach my machine
  52. to our LAN.  Countless other uses could be thought of.  It sets ERRORLEVEL
  53. to 0 for a Y response, and to 255 for a N response.
  54. Example:
  55.  
  56. ECHO OFF
  57. CLS
  58. -
  59. -        {Rest of batch file}
  60. -
  61. ECHO Login to network?
  62. ELF
  63. IF ERRORLEVEL 255 GOTO END
  64. NETWORK       {Run NETWORK.BAT}
  65. :END
  66.  
  67.  
  68. This produces:
  69.  
  70. -
  71. -        {Other things in batch file}
  72. -
  73. Login to network?
  74. (Y/N)?
  75.  
  76.  
  77. Note:  If you'd rather not have the (Y/N)? prompt, either re-assemble
  78. the program, or patch the string with a debugger.  Replace the ( with a $.
  79.